﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HexEditor_
{
    public interface DataType
    {
        //类型名称
        string GetName();

        //获取实例
        string GetExample();

        //完成解析需要的字节数
        int GetBytesRequired();

        //返回解析了几个Byte, res返回解析结果字符串
        int Parse(byte[] bytes, int offset, out string res);
        
    }

    public class DataTypeCustom : DataType
    {
        public string DataTypeStmt { get; set; }//描述字符串

        public string GetName()
        {
            return "Unnamed";
        }
        public int GetBytesRequired() 
        {
            return 0;
        }
        public int Parse(byte[] bytes, int offset, out string res)
        {
            res = "";
            return 0;
        }

        public string GetExample() { return "Custom Data Content"; }
    }
}
